<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('records', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('product_id');
            $table->string('error')->comment('故障');;
            $table->integer('rs')->comment('信号强度');
            $table->integer('it')->comment('内部温度');
            $table->integer('et')->comment('外部温度');
            $table->integer('rh')->comment('湿度');
            $table->integer('cp')->comment('风机转速');
            $table->string('5k')->comment('继电器状态');
            $table->string('dv')->comment('交流电压');
            $table->string('da')->comment('交流电流');
            $table->string('dw')->comment('有功功率');
            $table->string('dh')->comment('有功总电能');
            $table->string('ds')->comment('功率因素');
            $table->string('dc')->comment('二氧化碳排量');
            $table->string('df')->comment('频率');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('records');
    }
}
